#ifndef __APPDATA_H__
#include "cui.h"

#define APPDATA_INPUTSTATMACH_MENUBAR            0
#define APPDATA_INPUTSTATMACH_DATAVIEW           1

#define IS_INPUTSTATMACH_MENUBAR(APPDATA)       ((APPDATA)->input_statmach == APPDATA_INPUTSTATMACH_MENUBAR)
#define IS_INPUTSTATMACH_DATAVIEW(APPDATA)       ((APPDATA)->input_statmach == APPDATA_INPUTSTATMACH_DATAVIEW)

struct appdata_st {
    int input_statmach;
    int point_index;     // INPUTSTATMACH_DATAVIEW use this to save current panel index
	struct l0032_xtable_entry *entry;
};

/*
MENUBAR --RIGHT--> DATAVIEW --ESC--> MENUBAR
MENUBAR --ESC--> <POPSCREEN>
DATAVIEW --ENTER--> POPMENU --ESC--> DATAVIEW
*/

/*
struct l0032_xtable_valueenum {
	char valdesc[L0032_DXT_DESC_MAX_LEN];
	int  val;
};

struct l0032_xtable_namedpoint {
	char name[L0032_DXT_NAME_MAX_LEN];
	char desc[L0032_DXT_DESC_MAX_LEN];
	int nvalues;
	struct l0032_xtable_valueenum *valueenum;
};

struct l0032_xtable_entry {
	entry_handle hentry;
	char name[L0032_DXT_NAME_MAX_LEN];
	char desc[L0032_DXT_DESC_MAX_LEN];
	uint32_t flags;
	int npoints;
	struct l0032_xtable_namedpoint *namedpoints;	// for POINT_ENUM type usage, otherwise is NULL
};

struct l0032_xtable {
	size_t sz;
	char appname[L0032_DXT_NAME_MAX_LEN];
	char parselib[L0032_DXT_NAME_MAX_LEN];

	int nentries;
	int nrefentries;

	struct l0032_xtable_entry *entries;
	struct l0032_xtable_entry *refentries;
};
*/

int popmenu_load(struct appdata_st *appdata);
int popform_load(struct appdata_st *appdata);
#endif // !__APPDATA_H__
